import random
import string

# random.seed(22)


def generate_random_code(length=24):
    """
    Generate a random alphanumeric code of a given length.
    :param length: Length of the code to generate, default is 24
    :return: String containing the random code
    """
    # Define the possible characters: letters (both uppercase and lowercase) and digits
    characters = string.ascii_letters + string.digits

    # Generate a random code by selecting 'length' characters
    random_code = ''.join(random.choices(characters, k=length))

    return random_code


# Example usage
# if __name__ == "__main__":
#     print(generate_random_code())
#     print(generate_random_code())
#     print(generate_random_code())
